/*
 * Filename PreOrderClient.java 2022年10月13日
 * Copyright © Ehome Co.Ltd. All Rgiths Reserved.
 * @author wuyingchao
 */
package com.ehome.poct.core.api.feign;

import com.ehome.poct.core.api.dto.order.PrePlaceOrderDTO;
import com.ehome.poct.core.api.vo.order.OrderStatusVO;
import com.ehome.poct.core.api.vo.order.PreOrderPayReqDTO;
import com.ehome.poct.core.api.vo.order.PreOrderPayRspVO;
import com.ehome.poct.core.api.vo.order.PreOrderRspVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * PreOrderClient
 *
 * @author wyc
 * @since 2022/10/13 16:13
 **/
@FeignClient(value = "${service.poct-core:}${service.suffix.poct-core:}", contextId = "preOrder")
public interface PreOrderClient {
    @PostMapping("/pre/order/place")
    PreOrderRspVO place(@RequestBody PrePlaceOrderDTO preOrder);

    @PostMapping("/pre/order/rePlace/{orderNo}")
    PreOrderRspVO rePlace(@PathVariable String orderNo);

    /**
     * 唤起支付
     *
     * @param preOrderPayReqDTO
     * @return
     */
    @PostMapping("/pre/order/pay")
    PreOrderPayRspVO pay(PreOrderPayReqDTO preOrderPayReqDTO);

    /**
     * 查询订单状态
     *
     * @param orderNo
     * @return
     */
    @GetMapping("/pre/order/queryOrderStatus/{orderNo}")
    OrderStatusVO queryOrderStatus(@PathVariable String orderNo);
}